from geoalchemy2 import Geometry
from sqlalchemy import String, Integer, DateTime, DECIMAL, Column
from config.database import Base


class PlantPlot(Base):
    """
    种植地块表
    """

    __tablename__ = 'plant_plot'

    plot_id = Column(Integer, primary_key=True, autoincrement=True, nullable=False, comment='地块Id')
    plot_name = Column(String(255), nullable=True, comment='地块名称')
    plot_no = Column(String(255), nullable=True, comment='地块编号')
    plot_center_coordinates = Column(Geometry, nullable=True, comment='地块坐标')
    plot_boundary = Column(Geometry, nullable=True, comment='地块边界')
    year = Column(Integer, nullable=True, comment='数据年份')
    product_area_id = Column(Integer, nullable=True, comment='产区Id')
    product_area = Column(String(255), nullable=True, comment='产区')
    planter_id = Column(Integer, nullable=True, comment='种植主体Id')
    planter_name = Column(String(255), nullable=True, comment='种植主体')
    address = Column(String(255), nullable=True, comment='地址')
    plot_area_size = Column(DECIMAL, nullable=True, comment='地块面积')
    memo = Column(String(255), nullable=True, comment='备注')
    create_time = Column(DateTime, nullable=True, comment='创建时间')
    create_by = Column(String(255), nullable=True, comment='创建人')
    update_time = Column(DateTime, nullable=True, comment='更新时间')
    update_by = Column(DateTime, nullable=True, comment='更新人')



